package com.situ.day8homework2;

import java.util.Scanner;

import org.omg.CORBA.PUBLIC_MEMBER;

public class YihangTest {
	public static void main(String[] args) {
		Yinhang yinhang = new Yinhang();
		yinhang.setAccount(123456789);
		yinhang.setName("张三");
		yinhang.setAddress("山东");
		yinhang.setMinBalance(10);
		while (true) {
			Scanner scanner = new Scanner(System.in);
			System.out.println("------------------------------");
			System.out.println("查看信息按1： ");
			System.out.println("存款按2： ");
			System.out.println("取款按3： ");
			System.out.println("取卡请按0: ");
			System.out.println("------------------------------");
			int type = scanner.nextInt();
			if (type == 0) {
				break;
			}
			switch (type) {
			case 1:
				yinhang.query();//查看信息
				break;
			case 2:
//				while (true) {
				yinhang.query();//查看信息
					System.out.println("请输入要存款的金额：");
					yinhang.setCunkuan(scanner.nextInt());
					yinhang.deposit();//存款
//					System.out.println("继续存钱请按8： ");
//					if (type == 9) {
//						return;
//					}
//				}
					break;
			case 3:
				yinhang.query();//查看信息
				System.out.println("请输入取款金额： ");
				yinhang.setQukuan(scanner.nextInt());
				yinhang.withdraw();//取款
				break;
			default:
				System.out.println("错误");
				break;
			}
		}
		
		
		
		
	}
}
